package org.kjtc.init;


import org.kjtc.service.WxMpService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;





/**
 * 项目启动执行
 * Created by xiaojin on 2019/1/5/005.
 */
/*@Component
@Configurable
@EnableScheduling*/
public class InitAccessToken {
    private static Logger log = LoggerFactory.getLogger(InitAccessToken.class);

    @Autowired
    private   WxMpService wxMpService;
    /**
     * 定时执行获取token
     */
    @Scheduled(cron = "0 */1 * * * * ")
    public void initAccessTokenTask(){
        log.info("开始token");
        wxMpService.creatAccrssToken();
        log.info("结束token");
    }

}
